package com.wecan.base.PO;

import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.wecan.base.PO.base.MultiDatePO;
import com.wecan.base.enums.ItemType;
import com.wecan.base.enums.OrderStatus;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @Author liuzhihao
 * @Date 2022.02.24
 * @Version ${version}
 * @Description ${description}
 */
@Data
public class Order extends MultiDatePO {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private ItemType type;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long itemId;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String itemName;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer itemNum;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private BigDecimal itemPrice;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String itemImageUrl;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private BigDecimal totalFee;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private BigDecimal finalFee;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long couponId;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private OrderStatus status;

    @TableLogic
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Short deleted;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long finishDate;
}
